<?php require_once '../library/Question.php'; ?>
<?php require_once '../library/Score.php'; ?>
<?php
$Question = new Question();
$Question->checkUser();
$questions = $Question->setLevel(1)->find('ORDER BY `number` ASC', false);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Home</title>
    <link rel="stylesheet" href="../css/StyleSheet/styles.css" type="text/css"/>
    <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../lib/jquery-ui/jquery-ui-1.8.15.custom.min.js"></script>
    <script type="application/javascript" src="../js/logIn.js"></script>
    <style type="text/css">
        .msg {
            padding: 10px;
            text-align:  center;

        }
    </style>
</head>

<body>
<div id="container">
    <div id="header">
        <h1><span>FIND YOUR MAJOR</span></h1>

        <div id="slogan-text" class="header-slogan">your major partner</div>

    </div>
    <div id="nav">
        <ul>
            <Li><a href="./">Home</a></li>
            <Li><a href="about.php">About Us</a></li>
            <li><a href="">Majors</a></li>
            <Li><a href="">Schools</a></li>
            <Li><a href="contact.php">Contact Us</a></li>
            <Li><a href="student_info.php" id="quiz" class="quiz">Take Quiz</a></li>

        </ul>

    </div>
    <div id="content">

        <div id="page" style="width: 99%;">
            <h2>Welcome</h2>
            <div class="msg"></div>
            <form action="display_major.php" method="post">
                <table>
                    <?php if ($questions) { ?>
                    <?php while($question = mysql_fetch_object($questions)) { ?>
                    <tr>
                        <td class="numbering"><?php echo $question->number; ?>

                        </td>

                        <td class="question">
                            <label><?php echo $question->question; ?></label>
                            <?php $objectives = $Question->getObjectives($question->id, 'ORDER BY `objective_index` ASC'); ?>
                            <?php if (is_resource($objectives)) : ?>
                            <div class="objectives">
                                <?php while($objective = mysql_fetch_object($objectives)) : ?>
                                <p>
                                    <input type="radio" name="question_id_<?php echo $objective->question_id; ?>" value="<?php echo $objective->id . ':' . $objective->recomendation_group_id ?>" />&nbsp;

                                <strong>[<?php echo $objective->objective_index; ?>]</strong>&nbsp;

                                    <?php echo $objective->objective; ?>
                                </p>
                                <?php endwhile; ?>
                            </div>

                            <?php endif; ?>
                        </td>
                    </tr>
                    <?php } ?>
                    <?php } ?>
                    <tr>
                        <td></td>
                        <td><input type="submit" name="submit" value="Submit Answer" /></td>
                    </tr>
                </table>

            </form>
        </div>
        <div class="clear"></div>
    </div>

    <div id="footer">
        <p>&copy; 2012 ernydey,All rights reserved.</p>
    </div>

</div>
<div id="layer" class="layer">
    <div><!--modal box-->
        <form action="" method="post">
            <table>
                <tr></tr>
                <tr></tr>
                <tr>
                    <td width="100%"></td>
                </tr>
                <tr>
                    <td>User Name:</td>
                    <td><input name="userName" type="text" id="userName"/></td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td><input name="password" type="password" id="password"/></td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align:center;"><input name="submit2" type="submit" id="submit2"
                                                                      value="Log In"/></td>
                </tr>
            </table>
        </form>

    </div>
    <!--modal box ends-->
</div>
<!--layer box ends-->
</body>
</html>
